package com.kly.sc.api.application.controller.user.request;

import com.fqgj.common.api.ParamsObject;
import com.kly.sc.api.infras.enums.RestCodeEnum;
import com.kly.sc.api.infras.exception.ApplicationException;
import org.apache.commons.lang3.StringUtils;

/**
 * 获取用户IM token参数
 */
public class GetIMTokenRequest extends ParamsObject {

    /**
     * 用户内码
     */
    private String userCode;

    public String getUserCode() {
        return userCode;
    }

    public void setUserCode(String userCode) {
        this.userCode = userCode;
    }

    @Override
    public void validate() {
        if (StringUtils.isBlank(this.userCode)) {
            throw new ApplicationException(RestCodeEnum.USERID_NOT_EXIST_ERROR);
        }
    }
}
